/**
 * Created by Administrator on 2018/11/7 0007.
 */
const mongoose = require('mongoose');
const bookSortSchema = new mongoose.Schema({
    kind: {   //种类，电子书 、纸质书等
        type: Number,
        default: '',
    },
    name: {
        type: String,  //分类名称
        trim: true,
        default: '',
        maxlength: 15,
        required: true
    },
    parentId: {
        type: String,
        default: '*',
    },
    parentName: {
        type: String,
    }
},{timestamps: {createdAt: 'createTime', updatedAt: 'upDateTime'}})

const bookSortModel = mongoose.model('bookSort',bookSortSchema,'bookSort'); //创建集合（表）

module.exports = bookSortModel;